#include <stdio.h>
#include <ctype.h>
void is_letter(char ch);

int main(void)
{
    int ch;

    printf("输入一串字符串(EOF 结尾): ");
    while ((ch = getchar()) != EOF)
    {
        while (ch == '\n')
            ch = getchar();
        is_letter(ch);
    }
    printf("Bye!\n");

    return 0;
}

void is_letter(char ch)
{
    if (islower(ch))
        printf("%d ", ch - 'a' + 1);
    else if (isupper(ch))
        printf("%d ", ch - 'A' + 1);
    else
        printf("-1 ");
}